package cn.gzjp.modules.gas.service;

import java.util.List;

import cn.gzjp.modules.it.entity.Member;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.gzjp.common.persistence.Page;
import cn.gzjp.common.service.CrudService;
import cn.gzjp.modules.gas.entity.GasUser;
import cn.gzjp.modules.gas.dao.GasUserDao;

/**
 * 加油用户Service
 * @author zengcp
 * @version 2018-03-05
 */
@Service
@Transactional(readOnly = true)
public class GasUserService extends CrudService<GasUserDao, GasUser> {

	public GasUser get(String id) {
		return super.get(id);
	}
	
	public List<GasUser> findList(GasUser gasUser) {
		return super.findList(gasUser);
	}
	
	public Page<GasUser> findPage(Page<GasUser> page, GasUser gasUser) {
		return super.findPage(page, gasUser);
	}
	
	@Transactional(readOnly = false)
	public void save(GasUser gasUser) {
		GasUser m = get(gasUser.getId());
		if(m!=null){
			super.save(gasUser);
		}else{
			super.insert(gasUser, gasUser.getId());
		}
	}
	
	@Transactional(readOnly = false)
	public void delete(GasUser gasUser) {
		super.deleteByLogic(gasUser);
	}
	
}